#include "mini2440OutsideDeviceControlForm.h"
#include "ui_mini2440OutsideDeviceControlForm.h"

mini2440OutsideDeviceControlForm::mini2440OutsideDeviceControlForm(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::mini2440OutsideDeviceControlForm)
{
    ui->setupUi(this);
    t=new CaptureThread(ui->_wdVideoCapture);
}

mini2440OutsideDeviceControlForm::~mini2440OutsideDeviceControlForm()
{
    //t->devam = false;
    t->stopUlan();
    delete t;
    delete ui;

}

void mini2440OutsideDeviceControlForm::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void mini2440OutsideDeviceControlForm::closeEvent(QCloseEvent *event)
 {
    t->stopUlan();
    event->accept();
 }

void mini2440OutsideDeviceControlForm::showEvent ( QShowEvent * event )
 {
    if(t->devam==false){
        t->devam=true;
        t->startUlan();
    }
    event->accept();
 }

void mini2440OutsideDeviceControlForm::on__btClose_clicked()
{
    emit closeDoor();
}

void mini2440OutsideDeviceControlForm::on__btOpen_clicked()
{
    emit openDoor();
}

